package com.yms.web;

import com.yms.socket.web.Request;

import javax.servlet.*;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.Socket;

/**
 * @version : 1.0
 * @author: yangmingsong
 * @date: 2022/8/9-08-09-18:26
 * @description: spring5-test
 */
public abstract class YmsServlet extends HttpServlet {

    protected abstract void doService(HttpServletRequest var1, HttpServletResponse var2) throws Exception;

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //super.doGet(req, resp);
        try {
            doService(req,resp);
        } catch (Exception e) {
            e.printStackTrace();
        }
        String requestURI = req.getRequestURI();
        System.out.println(requestURI);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.doPost(req, resp);
    }

    @Override
    public void init(ServletConfig config) throws ServletException {
        super.init(config);
        System.out.println("init");
    }

}
